/*     */ package com.zimbra.cs.imap;
/*     */ 
/*     */ import com.zimbra.common.localconfig.KnownKey;
/*     */ import com.zimbra.common.localconfig.LC;
/*     */ import com.zimbra.common.util.Log;
/*     */ import com.zimbra.common.util.ZimbraLog;
/*     */ import com.zimbra.cs.security.sasl.Authenticator;
/*     */ import com.zimbra.cs.server.NioConnection;
/*     */ import com.zimbra.cs.server.NioHandler;
/*     */ import com.zimbra.cs.server.NioOutputStream;
/*     */ import java.io.IOException;
/*     */ import java.net.InetAddress;
/*     */ import java.net.InetSocketAddress;
/*     */ import javax.net.ssl.SSLException;
/*     */ import org.apache.mina.filter.codec.ProtocolDecoderException;
/*     */ import org.apache.mina.filter.codec.RecoverableProtocolDecoderException;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ final class NioImapHandler
/*     */   extends ImapHandler
/*     */   implements NioHandler
/*     */ {
/*     */   private final ImapConfig config;
/*     */   private final NioConnection connection;
/*     */   private NioImapRequest request;
/*     */   
/*     */   NioImapHandler(NioImapServer server, NioConnection conn)
/*     */   {
/*  38 */     super(server.getConfig());
/*  39 */     this.connection = conn;
/*  40 */     this.config = server.getConfig();
/*  41 */     this.output = conn.getOutputStream();
/*     */   }
/*     */   
/*     */   String getRemoteIp()
/*     */   {
/*  46 */     return this.connection.getRemoteAddress().getAddress().getHostAddress();
/*     */   }
/*     */   
/*     */   public void connectionOpened() throws IOException
/*     */   {
/*  51 */     sendGreeting();
/*     */   }
/*     */   
/*     */   public void messageReceived(Object msg) throws IOException, ProtocolDecoderException
/*     */   {
/*  56 */     if (this.request == null) {
/*  57 */       this.request = new NioImapRequest(this);
/*     */     }
/*     */     
/*  60 */     if (this.request.parse(msg))
/*     */     {
/*     */       try {
/*  63 */         if (!processRequest(this.request)) {
/*  64 */           dropConnection();
/*     */         }
/*     */       } finally {
/*  67 */         ZimbraLog.clearContext();
/*  68 */         if (this.request != null) {
/*  69 */           this.request.cleanup();
/*  70 */           this.request = null;
/*     */         }
/*     */       }
/*  73 */       if ((LC.imap_max_consecutive_error.intValue() > 0) && (this.consecutiveError >= LC.imap_max_consecutive_error.intValue())) {
/*  74 */         dropConnection();
/*     */       }
/*     */     }
/*     */   }
/*     */   
/*     */   public void exceptionCaught(Throwable e) throws IOException
/*     */   {
/*     */     try {
/*  82 */       if ((e instanceof SSLException)) {
/*  83 */         ZimbraLog.imap.error("Error detected by SSL subsystem, dropping connection:" + e);
/*  84 */         dropConnection(false);
/*  85 */       } else if ((e instanceof NioImapDecoder.TooBigLiteralException)) { String tag;
/*     */         String tag;
/*  87 */         if (this.request != null) {
/*  88 */           tag = this.request.getTag();
/*     */         } else {
/*     */           try {
/*  91 */             tag = ImapRequest.parseTag(((NioImapDecoder.TooBigLiteralException)e).getRequest());
/*     */           } catch (ImapParseException e1) {
/*  93 */             tag = "*";
/*     */           }
/*     */         }
/*  96 */         sendBAD(tag, e.getMessage());
/*  97 */       } else if ((e instanceof RecoverableProtocolDecoderException)) {
/*  98 */         sendBAD("*", e.getMessage());
/*  99 */       } else if ((e instanceof ProtocolDecoderException)) {
/* 100 */         sendBAD("*", e.getMessage());
/* 101 */         dropConnection(true);
/*     */       }
/*     */     } finally {
/* 104 */       if (this.request != null) {
/* 105 */         this.request.cleanup();
/* 106 */         this.request = null;
/*     */       }
/*     */     }
/*     */   }
/*     */   
/*     */   /* Error */
/*     */   private boolean processRequest(NioImapRequest req)
/*     */     throws IOException
/*     */   {
/*     */     // Byte code:
/*     */     //   0: aload_0
/*     */     //   1: getfield 42	com/zimbra/cs/imap/NioImapHandler:selectedFolder	Lcom/zimbra/cs/imap/ImapSession;
/*     */     //   4: astore_2
/*     */     //   5: aload_2
/*     */     //   6: ifnull +7 -> 13
/*     */     //   9: aload_2
/*     */     //   10: invokevirtual 43	com/zimbra/cs/imap/ImapSession:updateAccessTime	()V
/*     */     //   13: getstatic 44	com/zimbra/cs/stats/ZimbraPerf:STOPWATCH_IMAP	Lcom/zimbra/common/stats/StopWatch;
/*     */     //   16: invokevirtual 45	com/zimbra/common/stats/StopWatch:start	()J
/*     */     //   19: lstore_3
/*     */     //   20: aload_0
/*     */     //   21: invokevirtual 46	com/zimbra/cs/imap/NioImapHandler:checkAccountStatus	()Z
/*     */     //   24: ifne +92 -> 116
/*     */     //   27: iconst_0
/*     */     //   28: istore 5
/*     */     //   30: getstatic 44	com/zimbra/cs/stats/ZimbraPerf:STOPWATCH_IMAP	Lcom/zimbra/common/stats/StopWatch;
/*     */     //   33: lload_3
/*     */     //   34: invokevirtual 47	com/zimbra/common/stats/StopWatch:stop	(J)J
/*     */     //   37: lstore 6
/*     */     //   39: aload_0
/*     */     //   40: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   43: ifnull +50 -> 93
/*     */     //   46: getstatic 49	com/zimbra/cs/stats/ZimbraPerf:IMAP_TRACKER	Lcom/zimbra/cs/stats/ActivityTracker;
/*     */     //   49: aload_0
/*     */     //   50: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   53: invokevirtual 50	java/lang/String:toUpperCase	()Ljava/lang/String;
/*     */     //   56: lload_3
/*     */     //   57: invokevirtual 51	com/zimbra/cs/stats/ActivityTracker:addStat	(Ljava/lang/String;J)V
/*     */     //   60: getstatic 23	com/zimbra/common/util/ZimbraLog:imap	Lcom/zimbra/common/util/Log;
/*     */     //   63: ldc 52
/*     */     //   65: iconst_2
/*     */     //   66: anewarray 53	java/lang/Object
/*     */     //   69: dup
/*     */     //   70: iconst_0
/*     */     //   71: aload_0
/*     */     //   72: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   75: invokevirtual 50	java/lang/String:toUpperCase	()Ljava/lang/String;
/*     */     //   78: aastore
/*     */     //   79: dup
/*     */     //   80: iconst_1
/*     */     //   81: lload 6
/*     */     //   83: invokestatic 54	java/lang/Long:valueOf	(J)Ljava/lang/Long;
/*     */     //   86: aastore
/*     */     //   87: invokevirtual 55	com/zimbra/common/util/Log:info	(Ljava/lang/String;[Ljava/lang/Object;)V
/*     */     //   90: goto +23 -> 113
/*     */     //   93: getstatic 23	com/zimbra/common/util/ZimbraLog:imap	Lcom/zimbra/common/util/Log;
/*     */     //   96: ldc 56
/*     */     //   98: iconst_1
/*     */     //   99: anewarray 53	java/lang/Object
/*     */     //   102: dup
/*     */     //   103: iconst_0
/*     */     //   104: lload 6
/*     */     //   106: invokestatic 54	java/lang/Long:valueOf	(J)Ljava/lang/Long;
/*     */     //   109: aastore
/*     */     //   110: invokevirtual 55	com/zimbra/common/util/Log:info	(Ljava/lang/String;[Ljava/lang/Object;)V
/*     */     //   113: iload 5
/*     */     //   115: ireturn
/*     */     //   116: aload_0
/*     */     //   117: getfield 57	com/zimbra/cs/imap/NioImapHandler:authenticator	Lcom/zimbra/cs/security/sasl/Authenticator;
/*     */     //   120: ifnull +106 -> 226
/*     */     //   123: aload_0
/*     */     //   124: getfield 57	com/zimbra/cs/imap/NioImapHandler:authenticator	Lcom/zimbra/cs/security/sasl/Authenticator;
/*     */     //   127: invokevirtual 58	com/zimbra/cs/security/sasl/Authenticator:isComplete	()Z
/*     */     //   130: ifne +96 -> 226
/*     */     //   133: aload_0
/*     */     //   134: aload_1
/*     */     //   135: invokevirtual 59	com/zimbra/cs/imap/NioImapHandler:continueAuthentication	(Lcom/zimbra/cs/imap/ImapRequest;)Z
/*     */     //   138: istore 5
/*     */     //   140: getstatic 44	com/zimbra/cs/stats/ZimbraPerf:STOPWATCH_IMAP	Lcom/zimbra/common/stats/StopWatch;
/*     */     //   143: lload_3
/*     */     //   144: invokevirtual 47	com/zimbra/common/stats/StopWatch:stop	(J)J
/*     */     //   147: lstore 6
/*     */     //   149: aload_0
/*     */     //   150: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   153: ifnull +50 -> 203
/*     */     //   156: getstatic 49	com/zimbra/cs/stats/ZimbraPerf:IMAP_TRACKER	Lcom/zimbra/cs/stats/ActivityTracker;
/*     */     //   159: aload_0
/*     */     //   160: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   163: invokevirtual 50	java/lang/String:toUpperCase	()Ljava/lang/String;
/*     */     //   166: lload_3
/*     */     //   167: invokevirtual 51	com/zimbra/cs/stats/ActivityTracker:addStat	(Ljava/lang/String;J)V
/*     */     //   170: getstatic 23	com/zimbra/common/util/ZimbraLog:imap	Lcom/zimbra/common/util/Log;
/*     */     //   173: ldc 52
/*     */     //   175: iconst_2
/*     */     //   176: anewarray 53	java/lang/Object
/*     */     //   179: dup
/*     */     //   180: iconst_0
/*     */     //   181: aload_0
/*     */     //   182: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   185: invokevirtual 50	java/lang/String:toUpperCase	()Ljava/lang/String;
/*     */     //   188: aastore
/*     */     //   189: dup
/*     */     //   190: iconst_1
/*     */     //   191: lload 6
/*     */     //   193: invokestatic 54	java/lang/Long:valueOf	(J)Ljava/lang/Long;
/*     */     //   196: aastore
/*     */     //   197: invokevirtual 55	com/zimbra/common/util/Log:info	(Ljava/lang/String;[Ljava/lang/Object;)V
/*     */     //   200: goto +23 -> 223
/*     */     //   203: getstatic 23	com/zimbra/common/util/ZimbraLog:imap	Lcom/zimbra/common/util/Log;
/*     */     //   206: ldc 56
/*     */     //   208: iconst_1
/*     */     //   209: anewarray 53	java/lang/Object
/*     */     //   212: dup
/*     */     //   213: iconst_0
/*     */     //   214: lload 6
/*     */     //   216: invokestatic 54	java/lang/Long:valueOf	(J)Ljava/lang/Long;
/*     */     //   219: aastore
/*     */     //   220: invokevirtual 55	com/zimbra/common/util/Log:info	(Ljava/lang/String;[Ljava/lang/Object;)V
/*     */     //   223: iload 5
/*     */     //   225: ireturn
/*     */     //   226: aload_0
/*     */     //   227: aload_1
/*     */     //   228: invokevirtual 60	com/zimbra/cs/imap/NioImapHandler:executeRequest	(Lcom/zimbra/cs/imap/ImapRequest;)Z
/*     */     //   231: istore 5
/*     */     //   233: getstatic 44	com/zimbra/cs/stats/ZimbraPerf:STOPWATCH_IMAP	Lcom/zimbra/common/stats/StopWatch;
/*     */     //   236: lload_3
/*     */     //   237: invokevirtual 47	com/zimbra/common/stats/StopWatch:stop	(J)J
/*     */     //   240: lstore 6
/*     */     //   242: aload_0
/*     */     //   243: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   246: ifnull +50 -> 296
/*     */     //   249: getstatic 49	com/zimbra/cs/stats/ZimbraPerf:IMAP_TRACKER	Lcom/zimbra/cs/stats/ActivityTracker;
/*     */     //   252: aload_0
/*     */     //   253: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   256: invokevirtual 50	java/lang/String:toUpperCase	()Ljava/lang/String;
/*     */     //   259: lload_3
/*     */     //   260: invokevirtual 51	com/zimbra/cs/stats/ActivityTracker:addStat	(Ljava/lang/String;J)V
/*     */     //   263: getstatic 23	com/zimbra/common/util/ZimbraLog:imap	Lcom/zimbra/common/util/Log;
/*     */     //   266: ldc 52
/*     */     //   268: iconst_2
/*     */     //   269: anewarray 53	java/lang/Object
/*     */     //   272: dup
/*     */     //   273: iconst_0
/*     */     //   274: aload_0
/*     */     //   275: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   278: invokevirtual 50	java/lang/String:toUpperCase	()Ljava/lang/String;
/*     */     //   281: aastore
/*     */     //   282: dup
/*     */     //   283: iconst_1
/*     */     //   284: lload 6
/*     */     //   286: invokestatic 54	java/lang/Long:valueOf	(J)Ljava/lang/Long;
/*     */     //   289: aastore
/*     */     //   290: invokevirtual 55	com/zimbra/common/util/Log:info	(Ljava/lang/String;[Ljava/lang/Object;)V
/*     */     //   293: goto +23 -> 316
/*     */     //   296: getstatic 23	com/zimbra/common/util/ZimbraLog:imap	Lcom/zimbra/common/util/Log;
/*     */     //   299: ldc 56
/*     */     //   301: iconst_1
/*     */     //   302: anewarray 53	java/lang/Object
/*     */     //   305: dup
/*     */     //   306: iconst_0
/*     */     //   307: lload 6
/*     */     //   309: invokestatic 54	java/lang/Long:valueOf	(J)Ljava/lang/Long;
/*     */     //   312: aastore
/*     */     //   313: invokevirtual 55	com/zimbra/common/util/Log:info	(Ljava/lang/String;[Ljava/lang/Object;)V
/*     */     //   316: iload 5
/*     */     //   318: ireturn
/*     */     //   319: astore 5
/*     */     //   321: getstatic 23	com/zimbra/common/util/ZimbraLog:imap	Lcom/zimbra/common/util/Log;
/*     */     //   324: ldc 62
/*     */     //   326: aload 5
/*     */     //   328: invokevirtual 63	com/zimbra/common/util/Log:debug	(Ljava/lang/Object;Ljava/lang/Throwable;)V
/*     */     //   331: aload_0
/*     */     //   332: aload_1
/*     */     //   333: invokevirtual 33	com/zimbra/cs/imap/NioImapRequest:getTag	()Ljava/lang/String;
/*     */     //   336: ldc 64
/*     */     //   338: invokevirtual 65	com/zimbra/cs/imap/NioImapHandler:sendNO	(Ljava/lang/String;Ljava/lang/String;)V
/*     */     //   341: iconst_0
/*     */     //   342: istore 6
/*     */     //   344: getstatic 44	com/zimbra/cs/stats/ZimbraPerf:STOPWATCH_IMAP	Lcom/zimbra/common/stats/StopWatch;
/*     */     //   347: lload_3
/*     */     //   348: invokevirtual 47	com/zimbra/common/stats/StopWatch:stop	(J)J
/*     */     //   351: lstore 7
/*     */     //   353: aload_0
/*     */     //   354: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   357: ifnull +50 -> 407
/*     */     //   360: getstatic 49	com/zimbra/cs/stats/ZimbraPerf:IMAP_TRACKER	Lcom/zimbra/cs/stats/ActivityTracker;
/*     */     //   363: aload_0
/*     */     //   364: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   367: invokevirtual 50	java/lang/String:toUpperCase	()Ljava/lang/String;
/*     */     //   370: lload_3
/*     */     //   371: invokevirtual 51	com/zimbra/cs/stats/ActivityTracker:addStat	(Ljava/lang/String;J)V
/*     */     //   374: getstatic 23	com/zimbra/common/util/ZimbraLog:imap	Lcom/zimbra/common/util/Log;
/*     */     //   377: ldc 52
/*     */     //   379: iconst_2
/*     */     //   380: anewarray 53	java/lang/Object
/*     */     //   383: dup
/*     */     //   384: iconst_0
/*     */     //   385: aload_0
/*     */     //   386: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   389: invokevirtual 50	java/lang/String:toUpperCase	()Ljava/lang/String;
/*     */     //   392: aastore
/*     */     //   393: dup
/*     */     //   394: iconst_1
/*     */     //   395: lload 7
/*     */     //   397: invokestatic 54	java/lang/Long:valueOf	(J)Ljava/lang/Long;
/*     */     //   400: aastore
/*     */     //   401: invokevirtual 55	com/zimbra/common/util/Log:info	(Ljava/lang/String;[Ljava/lang/Object;)V
/*     */     //   404: goto +23 -> 427
/*     */     //   407: getstatic 23	com/zimbra/common/util/ZimbraLog:imap	Lcom/zimbra/common/util/Log;
/*     */     //   410: ldc 56
/*     */     //   412: iconst_1
/*     */     //   413: anewarray 53	java/lang/Object
/*     */     //   416: dup
/*     */     //   417: iconst_0
/*     */     //   418: lload 7
/*     */     //   420: invokestatic 54	java/lang/Long:valueOf	(J)Ljava/lang/Long;
/*     */     //   423: aastore
/*     */     //   424: invokevirtual 55	com/zimbra/common/util/Log:info	(Ljava/lang/String;[Ljava/lang/Object;)V
/*     */     //   427: iload 6
/*     */     //   429: ireturn
/*     */     //   430: astore 5
/*     */     //   432: aload_0
/*     */     //   433: aload 5
/*     */     //   435: invokevirtual 66	com/zimbra/cs/imap/NioImapHandler:handleParseException	(Lcom/zimbra/cs/imap/ImapParseException;)V
/*     */     //   438: iconst_1
/*     */     //   439: istore 6
/*     */     //   441: getstatic 44	com/zimbra/cs/stats/ZimbraPerf:STOPWATCH_IMAP	Lcom/zimbra/common/stats/StopWatch;
/*     */     //   444: lload_3
/*     */     //   445: invokevirtual 47	com/zimbra/common/stats/StopWatch:stop	(J)J
/*     */     //   448: lstore 7
/*     */     //   450: aload_0
/*     */     //   451: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   454: ifnull +50 -> 504
/*     */     //   457: getstatic 49	com/zimbra/cs/stats/ZimbraPerf:IMAP_TRACKER	Lcom/zimbra/cs/stats/ActivityTracker;
/*     */     //   460: aload_0
/*     */     //   461: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   464: invokevirtual 50	java/lang/String:toUpperCase	()Ljava/lang/String;
/*     */     //   467: lload_3
/*     */     //   468: invokevirtual 51	com/zimbra/cs/stats/ActivityTracker:addStat	(Ljava/lang/String;J)V
/*     */     //   471: getstatic 23	com/zimbra/common/util/ZimbraLog:imap	Lcom/zimbra/common/util/Log;
/*     */     //   474: ldc 52
/*     */     //   476: iconst_2
/*     */     //   477: anewarray 53	java/lang/Object
/*     */     //   480: dup
/*     */     //   481: iconst_0
/*     */     //   482: aload_0
/*     */     //   483: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   486: invokevirtual 50	java/lang/String:toUpperCase	()Ljava/lang/String;
/*     */     //   489: aastore
/*     */     //   490: dup
/*     */     //   491: iconst_1
/*     */     //   492: lload 7
/*     */     //   494: invokestatic 54	java/lang/Long:valueOf	(J)Ljava/lang/Long;
/*     */     //   497: aastore
/*     */     //   498: invokevirtual 55	com/zimbra/common/util/Log:info	(Ljava/lang/String;[Ljava/lang/Object;)V
/*     */     //   501: goto +23 -> 524
/*     */     //   504: getstatic 23	com/zimbra/common/util/ZimbraLog:imap	Lcom/zimbra/common/util/Log;
/*     */     //   507: ldc 56
/*     */     //   509: iconst_1
/*     */     //   510: anewarray 53	java/lang/Object
/*     */     //   513: dup
/*     */     //   514: iconst_0
/*     */     //   515: lload 7
/*     */     //   517: invokestatic 54	java/lang/Long:valueOf	(J)Ljava/lang/Long;
/*     */     //   520: aastore
/*     */     //   521: invokevirtual 55	com/zimbra/common/util/Log:info	(Ljava/lang/String;[Ljava/lang/Object;)V
/*     */     //   524: iload 6
/*     */     //   526: ireturn
/*     */     //   527: astore 5
/*     */     //   529: getstatic 23	com/zimbra/common/util/ZimbraLog:imap	Lcom/zimbra/common/util/Log;
/*     */     //   532: ldc 68
/*     */     //   534: aload 5
/*     */     //   536: invokevirtual 63	com/zimbra/common/util/Log:debug	(Ljava/lang/Object;Ljava/lang/Throwable;)V
/*     */     //   539: iconst_0
/*     */     //   540: istore 6
/*     */     //   542: getstatic 44	com/zimbra/cs/stats/ZimbraPerf:STOPWATCH_IMAP	Lcom/zimbra/common/stats/StopWatch;
/*     */     //   545: lload_3
/*     */     //   546: invokevirtual 47	com/zimbra/common/stats/StopWatch:stop	(J)J
/*     */     //   549: lstore 7
/*     */     //   551: aload_0
/*     */     //   552: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   555: ifnull +50 -> 605
/*     */     //   558: getstatic 49	com/zimbra/cs/stats/ZimbraPerf:IMAP_TRACKER	Lcom/zimbra/cs/stats/ActivityTracker;
/*     */     //   561: aload_0
/*     */     //   562: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   565: invokevirtual 50	java/lang/String:toUpperCase	()Ljava/lang/String;
/*     */     //   568: lload_3
/*     */     //   569: invokevirtual 51	com/zimbra/cs/stats/ActivityTracker:addStat	(Ljava/lang/String;J)V
/*     */     //   572: getstatic 23	com/zimbra/common/util/ZimbraLog:imap	Lcom/zimbra/common/util/Log;
/*     */     //   575: ldc 52
/*     */     //   577: iconst_2
/*     */     //   578: anewarray 53	java/lang/Object
/*     */     //   581: dup
/*     */     //   582: iconst_0
/*     */     //   583: aload_0
/*     */     //   584: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   587: invokevirtual 50	java/lang/String:toUpperCase	()Ljava/lang/String;
/*     */     //   590: aastore
/*     */     //   591: dup
/*     */     //   592: iconst_1
/*     */     //   593: lload 7
/*     */     //   595: invokestatic 54	java/lang/Long:valueOf	(J)Ljava/lang/Long;
/*     */     //   598: aastore
/*     */     //   599: invokevirtual 55	com/zimbra/common/util/Log:info	(Ljava/lang/String;[Ljava/lang/Object;)V
/*     */     //   602: goto +23 -> 625
/*     */     //   605: getstatic 23	com/zimbra/common/util/ZimbraLog:imap	Lcom/zimbra/common/util/Log;
/*     */     //   608: ldc 56
/*     */     //   610: iconst_1
/*     */     //   611: anewarray 53	java/lang/Object
/*     */     //   614: dup
/*     */     //   615: iconst_0
/*     */     //   616: lload 7
/*     */     //   618: invokestatic 54	java/lang/Long:valueOf	(J)Ljava/lang/Long;
/*     */     //   621: aastore
/*     */     //   622: invokevirtual 55	com/zimbra/common/util/Log:info	(Ljava/lang/String;[Ljava/lang/Object;)V
/*     */     //   625: iload 6
/*     */     //   627: ireturn
/*     */     //   628: astore 9
/*     */     //   630: getstatic 44	com/zimbra/cs/stats/ZimbraPerf:STOPWATCH_IMAP	Lcom/zimbra/common/stats/StopWatch;
/*     */     //   633: lload_3
/*     */     //   634: invokevirtual 47	com/zimbra/common/stats/StopWatch:stop	(J)J
/*     */     //   637: lstore 10
/*     */     //   639: aload_0
/*     */     //   640: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   643: ifnull +50 -> 693
/*     */     //   646: getstatic 49	com/zimbra/cs/stats/ZimbraPerf:IMAP_TRACKER	Lcom/zimbra/cs/stats/ActivityTracker;
/*     */     //   649: aload_0
/*     */     //   650: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   653: invokevirtual 50	java/lang/String:toUpperCase	()Ljava/lang/String;
/*     */     //   656: lload_3
/*     */     //   657: invokevirtual 51	com/zimbra/cs/stats/ActivityTracker:addStat	(Ljava/lang/String;J)V
/*     */     //   660: getstatic 23	com/zimbra/common/util/ZimbraLog:imap	Lcom/zimbra/common/util/Log;
/*     */     //   663: ldc 52
/*     */     //   665: iconst_2
/*     */     //   666: anewarray 53	java/lang/Object
/*     */     //   669: dup
/*     */     //   670: iconst_0
/*     */     //   671: aload_0
/*     */     //   672: getfield 48	com/zimbra/cs/imap/NioImapHandler:lastCommand	Ljava/lang/String;
/*     */     //   675: invokevirtual 50	java/lang/String:toUpperCase	()Ljava/lang/String;
/*     */     //   678: aastore
/*     */     //   679: dup
/*     */     //   680: iconst_1
/*     */     //   681: lload 10
/*     */     //   683: invokestatic 54	java/lang/Long:valueOf	(J)Ljava/lang/Long;
/*     */     //   686: aastore
/*     */     //   687: invokevirtual 55	com/zimbra/common/util/Log:info	(Ljava/lang/String;[Ljava/lang/Object;)V
/*     */     //   690: goto +23 -> 713
/*     */     //   693: getstatic 23	com/zimbra/common/util/ZimbraLog:imap	Lcom/zimbra/common/util/Log;
/*     */     //   696: ldc 56
/*     */     //   698: iconst_1
/*     */     //   699: anewarray 53	java/lang/Object
/*     */     //   702: dup
/*     */     //   703: iconst_0
/*     */     //   704: lload 10
/*     */     //   706: invokestatic 54	java/lang/Long:valueOf	(J)Ljava/lang/Long;
/*     */     //   709: aastore
/*     */     //   710: invokevirtual 55	com/zimbra/common/util/Log:info	(Ljava/lang/String;[Ljava/lang/Object;)V
/*     */     //   713: aload 9
/*     */     //   715: athrow
/*     */     // Line number table:
/*     */     //   Java source line #112	-> byte code offset #0
/*     */     //   Java source line #113	-> byte code offset #5
/*     */     //   Java source line #114	-> byte code offset #9
/*     */     //   Java source line #116	-> byte code offset #13
/*     */     //   Java source line #119	-> byte code offset #20
/*     */     //   Java source line #120	-> byte code offset #27
/*     */     //   Java source line #139	-> byte code offset #30
/*     */     //   Java source line #140	-> byte code offset #39
/*     */     //   Java source line #141	-> byte code offset #46
/*     */     //   Java source line #142	-> byte code offset #60
/*     */     //   Java source line #144	-> byte code offset #93
/*     */     //   Java source line #147	-> byte code offset #113
/*     */     //   Java source line #122	-> byte code offset #116
/*     */     //   Java source line #123	-> byte code offset #133
/*     */     //   Java source line #139	-> byte code offset #140
/*     */     //   Java source line #140	-> byte code offset #149
/*     */     //   Java source line #141	-> byte code offset #156
/*     */     //   Java source line #142	-> byte code offset #170
/*     */     //   Java source line #144	-> byte code offset #203
/*     */     //   Java source line #147	-> byte code offset #223
/*     */     //   Java source line #126	-> byte code offset #226
/*     */     //   Java source line #139	-> byte code offset #233
/*     */     //   Java source line #140	-> byte code offset #242
/*     */     //   Java source line #141	-> byte code offset #249
/*     */     //   Java source line #142	-> byte code offset #263
/*     */     //   Java source line #144	-> byte code offset #296
/*     */     //   Java source line #147	-> byte code offset #316
/*     */     //   Java source line #127	-> byte code offset #319
/*     */     //   Java source line #128	-> byte code offset #321
/*     */     //   Java source line #129	-> byte code offset #331
/*     */     //   Java source line #130	-> byte code offset #341
/*     */     //   Java source line #139	-> byte code offset #344
/*     */     //   Java source line #140	-> byte code offset #353
/*     */     //   Java source line #141	-> byte code offset #360
/*     */     //   Java source line #142	-> byte code offset #374
/*     */     //   Java source line #144	-> byte code offset #407
/*     */     //   Java source line #147	-> byte code offset #427
/*     */     //   Java source line #131	-> byte code offset #430
/*     */     //   Java source line #132	-> byte code offset #432
/*     */     //   Java source line #133	-> byte code offset #438
/*     */     //   Java source line #139	-> byte code offset #441
/*     */     //   Java source line #140	-> byte code offset #450
/*     */     //   Java source line #141	-> byte code offset #457
/*     */     //   Java source line #142	-> byte code offset #471
/*     */     //   Java source line #144	-> byte code offset #504
/*     */     //   Java source line #147	-> byte code offset #524
/*     */     //   Java source line #134	-> byte code offset #527
/*     */     //   Java source line #135	-> byte code offset #529
/*     */     //   Java source line #136	-> byte code offset #539
/*     */     //   Java source line #139	-> byte code offset #542
/*     */     //   Java source line #140	-> byte code offset #551
/*     */     //   Java source line #141	-> byte code offset #558
/*     */     //   Java source line #142	-> byte code offset #572
/*     */     //   Java source line #144	-> byte code offset #605
/*     */     //   Java source line #147	-> byte code offset #625
/*     */     //   Java source line #139	-> byte code offset #628
/*     */     //   Java source line #140	-> byte code offset #639
/*     */     //   Java source line #141	-> byte code offset #646
/*     */     //   Java source line #142	-> byte code offset #660
/*     */     //   Java source line #144	-> byte code offset #693
/*     */     //   Java source line #147	-> byte code offset #713
/*     */     // Local variable table:
/*     */     //   start	length	slot	name	signature
/*     */     //   0	716	0	this	NioImapHandler
/*     */     //   0	716	1	req	NioImapRequest
/*     */     //   4	6	2	i4selected	ImapSession
/*     */     //   19	638	3	start	long
/*     */     //   28	289	5	bool	boolean
/*     */     //   319	8	5	e	ImapProxyException
/*     */     //   430	4	5	e	ImapParseException
/*     */     //   527	8	5	e	ImapException
/*     */     //   37	68	6	elapsed	long
/*     */     //   147	68	6	elapsed	long
/*     */     //   240	386	6	elapsed	long
/*     */     //   351	68	7	elapsed	long
/*     */     //   448	68	7	elapsed	long
/*     */     //   549	68	7	elapsed	long
/*     */     //   628	86	9	localObject	Object
/*     */     //   637	68	10	elapsed	long
/*     */     // Exception table:
/*     */     //   from	to	target	type
/*     */     //   226	233	319	com/zimbra/cs/imap/ImapProxyException
/*     */     //   226	233	430	com/zimbra/cs/imap/ImapParseException
/*     */     //   226	233	527	com/zimbra/cs/imap/ImapException
/*     */     //   20	30	628	finally
/*     */     //   116	140	628	finally
/*     */     //   226	233	628	finally
/*     */     //   319	344	628	finally
/*     */     //   430	441	628	finally
/*     */     //   527	542	628	finally
/*     */     //   628	630	628	finally
/*     */   }
/*     */   
/*     */   public void dropConnection()
/*     */   {
/* 152 */     dropConnection(true);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public void connectionClosed()
/*     */   {
/* 161 */     if (this.request != null) {
/* 162 */       this.request.cleanup();
/* 163 */       this.request = null;
/*     */     }
/*     */     try {
/* 166 */       unsetSelectedFolder(false);
/*     */     }
/*     */     catch (Exception ignore) {}
/*     */   }
/*     */   
/*     */   public void connectionIdle()
/*     */   {
/* 173 */     ZimbraLog.imap.debug("dropping connection for inactivity");
/* 174 */     dropConnection();
/*     */   }
/*     */   
/*     */   public void setLoggingContext()
/*     */   {
/* 179 */     super.setLoggingContext();
/*     */   }
/*     */   
/*     */   void sendLine(String line, boolean flush) throws IOException
/*     */   {
/* 184 */     NioOutputStream out = (NioOutputStream)this.output;
/* 185 */     if (out != null) {
/* 186 */       out.write(line);
/* 187 */       out.write(LINE_SEPARATOR_BYTES);
/* 188 */       if (flush) {
/* 189 */         out.flush();
/*     */       }
/*     */     }
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   void dropConnection(boolean sendBanner)
/*     */   {
/* 202 */     if ((this.credentials != null) && (!this.goodbyeSent)) {
/* 203 */       ZimbraLog.imap.info("dropping connection for user %s (server-initiated)", new Object[] { this.credentials.getUsername() });
/*     */     }
/* 205 */     if (!this.connection.isOpen()) {
/* 206 */       return;
/*     */     }
/* 208 */     if ((sendBanner) && (!this.goodbyeSent)) {
/* 209 */       sendBYE();
/*     */     }
/* 211 */     this.connection.close();
/*     */   }
/*     */   
/*     */   void close()
/*     */   {
/* 216 */     dropConnection(true);
/*     */   }
/*     */   
/*     */   void enableInactivityTimer()
/*     */   {
/* 221 */     this.connection.setMaxIdleSeconds(this.config.getAuthenticatedMaxIdleTime());
/*     */   }
/*     */   
/*     */   void completeAuthentication() throws IOException
/*     */   {
/* 226 */     if (this.authenticator.isEncryptionEnabled()) {
/* 227 */       this.connection.startSasl(this.authenticator.getSaslServer());
/*     */     }
/* 229 */     this.authenticator.sendSuccess();
/*     */   }
/*     */   
/*     */   boolean doSTARTTLS(String tag) throws IOException
/*     */   {
/* 234 */     if (!checkState(tag, ImapHandler.State.NOT_AUTHENTICATED))
/* 235 */       return true;
/* 236 */     if (this.startedTLS) {
/* 237 */       sendNO(tag, "TLS already started");
/* 238 */       return true;
/*     */     }
/*     */     
/* 241 */     this.connection.startTls();
/* 242 */     sendOK(tag, "begin TLS negotiation now");
/* 243 */     this.startedTLS = true;
/* 244 */     return true;
/*     */   }
/*     */   
/*     */   InetSocketAddress getLocalAddress()
/*     */   {
/* 249 */     return this.connection.getLocalAddress();
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/imap/NioImapHandler.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */